<!DOCTYPE html>
<html lang="en">
	<head>
		<title> New Document </title>
		<meta charset="utf-8">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<!-- Bootstrap -->
		<link href="${webRoot}resources/css/bootstrap.min.css" rel="stylesheet" media="screen">
		<link href="${webRoot}resources/css/style.css" rel="stylesheet">
		<script src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
		<style type="text/css">
		.black_overlay{
		display: none;
		position: absolute;
		top: 0%;
		left: 0%;
		width: 100%;
		height: 100%;
		background-color: black;
		z-index:1001;
		-moz-opacity: 0.8;
		opacity:.80;
		filter: alpha(opacity=80);
		}
		.white_content {
		display: none;
		position: absolute;
		top: 10%;
		left: 10%;
		width: 80%;
		height: 80%;
		border: 16px solid lightblue;
		background-color: white;
		z-index:1002;
		overflow: auto;
		}
		.white_content_small {
		display: none;
		position: absolute;
		top: 20%;
		left: 30%;
		width: 40%;
		height: 50%;
		border: 16px solid lightblue;
		background-color: white;
		z-index:1002;
		overflow: auto;
		}
	</style>
	</head>
<body class="main">
	<div class="wrap">
		<div class="">
		<ul class="breadcrumb">
		    <li><span id="test">您当前的位置：</span><a href="#">首页</a> <span class="divider">>></span></li>
		    <li class="active">${listNote}</li>
	    </ul>
	    <!--  
			<form class="form-inline">
				<input type="text" class="input-small" id="userName" placeholder="会员名">
				<input type="text" class="input-small" id="usertelephone" placeholder="手机号">			
				<button type="button" class="btn" onclick="serachHref();">搜索</button>
			</form>-->
		</div>
		<div id="div">
		<div class="">
			<table class="table table-bordered table-striped table-hover">
				<thead>
					<tr>
						<th>发言人</th>
						<th>加分</th>
						<th>减分</th>
						<th>发言时间</th>
						<th>发言文字</th>
						<th>所属内容</th>
						<th>发言音频</th>
						<th>发言图片</th>
						<th>发言视频</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				<#if noteList?exists>
				<#list noteList as noteEntity>
					<tr>
						<td>${noteEntity.username}</td>
						<td>${noteEntity.topscore}</td>
						<td>${noteEntity.stampscore}</td>
						<td>${noteEntity.time?string("yyyy-MM-dd HH:mm:ss")}</td>
						<td>${noteEntity.word}</td>
						<td>${noteEntity.title}</td>
						<td>${noteEntity.voice}</td>
						<td>${noteEntity.image}</td>
						<td>${noteEntity.video}</td>
						<td>
						<a href="javascript:viewComment(${noteEntity.id})">查看评论</a>
						<a href="javascript:deleteNote(${noteEntity.id})">删除</a></td>
					</tr>
				</#list>
				<#else>
				   	 <tr>
				       <td colspan="10">没有查询到记录！</td>
				   </tr>
				</#if>
				</tbody>
			</table>			
		</div>
		<#if noteList?exists>
		<div class="pagination pagination-right">
		  <input type="hidden" name="userSelectBean" id="userSelectBean" value="${memberEntity}"/>
		  <ul>
		    <#if pageEntity.page==1>
		    <li class="disabled"><a href="#">&laquo;</a></li>
		    <#else>
		    <li><a href="javascript:pageHref(${pageEntity.page-1},${pageEntity.totalPage},${pageEntity.pageSize})">&laquo;</a></li>
		    </#if>
		    <#list 1..pageEntity.totalPage as i>
		         <#if pageEntity.page==i>
		    <li class="active"><a href="#">${i}</a></li>
		         <#else>
		    <li><a href="javascript:pageHref(${i},${pageEntity.totalPage},${pageEntity.pageSize})">${i}</a></li>
		        </#if>
		    </#list>
		   <#if pageEntity.page==pageEntity.totalPage>
		    <li class="disabled"><a href="#">»</a></li>
		    <#else>
		    <li><a href="javascript:pageHref(${pageEntity.page+1},${pageEntity.totalPage},${pageEntity.pageSize})">»</a></li>
		    </#if>
		  </ul>
		</div>
		</#if>
		</div>				
	</div>
	<!--弹出层时背景层DIV-->
<div id="fade" class="black_overlay">
</div>
<div id="MyDiv" class="white_content">
</div>				
	<script src="${webRoot}resources/js/bootstrap.min.js"></script>
	<script src="${webRoot}resources/js/js.js"></script>
	<script type="text/javascript">
	    function pageHref(page,totalPage,pageSize){
	    	$.ajax({url:"${webRoot}note/noteAjaxList.do?page="+page+"&pageSize="+pageSize+
	    			"&totalPage="+totalPage,
				   type:"post",
				   cache:"false",
				   error : function() {
					   alert("系统繁忙，请稍后再试！");
					},
				   success:function(msg){
					   $(".main").html(msg);
				   }
				});
	    }
	    
	    function deleteComment(id,noteId){
	    $.ajax({url:"${webRoot}note/deleteComment.do?id="+id+"&noteId="+noteId,
				   type:"post",
				   cache:"false",
				   error : function() {
					   alert("系统繁忙，请稍后再试！");
					},
				   success:function(msg){
					   $("#MyDiv").html(msg);
						   ShowDiv('MyDiv','fade');
				   }
				});
	    }
	    function tipList(id){
	    	$.ajax({url:"${webRoot}note/tipList.do?id="+id,
				   type:"post",
				   cache:"false",
				   error : function() {
					   alert("系统繁忙，请稍后再试！");
					},
				   success:function(msg){
					   $("#MyDiv").html(msg);
						   ShowDiv('MyDiv','fade');
				   }
				});
	    }
	    function pageComment1(page,totalPage,pageSize){
	    var id = $("#id").val();
	    	$.ajax({url:"${webRoot}note/commentAjaxList.do?page="+page+"&pageSize="+pageSize+
	    			"&totalPage="+totalPage+"&noteId="+id,
				   type:"post",
				   cache:"false",
				   error : function() {
					   alert("系统繁忙，请稍后再试！");
					},
				   success:function(msg){
					   $("#MyDiv").html(msg);
						   ShowDiv('MyDiv','fade');
				   }
				});
	    }
	    function deleteNote(id){
				if(confirm("确定删除该发言吗？")){
			    	$.ajax({url:"${webRoot}note/deleteNote.do?noteId="+id,
						   type:"delete",
						   cache:"false",
						   error : function() {
							   alert("系统繁忙，请稍后再试！");
							},
						   success:function(msg){
							   $(".main").html(msg);
						   }
						});
					}
		}
	    
	    function viewComment(id){
		    	$.ajax({url:"${webRoot}note/viewComment.do?noteId="+id,
					   type:"post",
					   cache:"false",
					   error : function() {
						   alert("系统繁忙，请稍后再试！");
						},
					   success:function(msg){
						   $("#MyDiv").html(msg);
						   ShowDiv('MyDiv','fade');
					   }
					});
	}
	//弹出隐藏层
	function ShowDiv(show_div,bg_div){
	document.getElementById(show_div).style.display='block';
	document.getElementById(bg_div).style.display='block' ;
	var bgdiv = document.getElementById(bg_div);
	bgdiv.style.width = document.body.scrollWidth;
	// bgdiv.style.height = $(document).height();
	$("#"+bg_div).height($(document).height());
	};
	//关闭弹出层
	function CloseDiv(show_div,bg_div)
	{
	document.getElementById(show_div).style.display='none';
	document.getElementById(bg_div).style.display='none';
	};
	</script>
</body>
</html>
